{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 用户画像-案例\n",
    "\n",
    "\n",
    "### 基于用户搜索关键词数据为用户打上标签（年龄，性别，学历）\n",
    "\n",
    "## 整体流程\n",
    "<img src=\"./img/1.png\" alt=\"FAO\" width=\"500\" align=\"right\">\n",
    "### （一）数据预处理\n",
    "* 编码方式转换\n",
    "* 对数据搜索内容进行分词\n",
    "* 词性过滤\n",
    "* 数据检查\n",
    "\n",
    "### （二）特征选择\n",
    "* 建立word2vec词向量模型\n",
    "* 对所有搜索数据求平均向量\n",
    "\n",
    "### （三）建模预测\n",
    "* 不同机器学习模型对比\n",
    "* 堆叠模型"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 将原始数据转换成utf-8编码，防止后续出现各种编码问题\n",
    "由于原始数据比较大，在分词与过滤阶段会比较慢，这里我们选择了原始数据中的1W个"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "IOPub data rate exceeded.\n",
      "The notebook server will temporarily stop sending output\n",
      "to the client in order to avoid crashing it.\n",
      "To change this limit, set the config variable\n",
      "`--NotebookApp.iopub_data_rate_limit`.\n",
      "\n",
      "Current values:\n",
      "NotebookApp.iopub_data_rate_limit=1000000.0 (bytes/sec)\n",
      "NotebookApp.rate_limit_window=3.0 (secs)\n",
      "\n"
     ]
    }
   ],
   "source": [
    "import csv\n",
    "\n",
    "#原始数据存储路径\n",
    "data_path = './data/user_tag_query.10W.TRAIN' \n",
    "#生成数据路径\n",
    "csvfile = open(data_path + '-1w.csv', 'w')\n",
    "writer = csv.writer(csvfile)\n",
    "writer.writerow(['ID', 'age', 'Gender', 'Education', 'QueryList'])\n",
    "#转换成utf-8编码的格式\n",
    "with open(data_path, 'r',encoding='gb18030',errors='ignore') as f:\n",
    "    lines = f.readlines()\n",
    "    print(lines)\n",
    "    for line in lines[0:10000]:\n",
    "        try:\n",
    "            line.strip()          \n",
    "            data = line.split(\"\\t\")\n",
    "            writedata = [data[0], data[1], data[2], data[3]]\n",
    "            querystr = ''\n",
    "            data[-1]=data[-1][:-1]\n",
    "            for d in data[4:]:\n",
    "                try:\n",
    "                    cur_str = d.encode('utf8')\n",
    "                    cur_str = cur_str.decode('utf8')\n",
    "                    querystr += cur_str + '\\t'\n",
    "                except:\n",
    "                    continue\n",
    "                    #print (data[0][0:10])\n",
    "            querystr = querystr[:-1]\n",
    "            writedata.append(querystr)\n",
    "            writer.writerow(writedata)\n",
    "        except:\n",
    "            #print (data[0][0:20])\n",
    "            continue"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "测试集的编码转换方式同上"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [],
   "source": [
    "data_path = './data/user_tag_query.10W.TEST'\n",
    "\n",
    "csvfile = open(data_path + '-1w.csv', 'w')\n",
    "writer = csv.writer(csvfile)\n",
    "writer.writerow(['ID', 'QueryList'])\n",
    "with open(data_path, 'r',encoding='gb18030',errors='ignore') as f:\n",
    "    lines = f.readlines()\n",
    "    for line in lines[0:10000]:\n",
    "        try:\n",
    "            data = line.split(\"\\t\")\n",
    "            writedata = [data[0]]\n",
    "            querystr = ''\n",
    "            data[-1]=data[-1][:-1]\n",
    "            for d in data[1:]:\n",
    "                try:                  \n",
    "                    cur_str = d.encode('utf8')\n",
    "                    cur_str = cur_str.decode('utf8')\n",
    "                    querystr += cur_str + '\\t'               \n",
    "                except:\n",
    "                    #print (data[0][0:10])\n",
    "                    continue\n",
    "            querystr = querystr[:-1]\n",
    "            writedata.append(querystr)\n",
    "            writer.writerow(writedata)\n",
    "        except:\n",
    "            #print (data[0][0:20])\n",
    "            continue"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 生成对应的数据表"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'pandas.core.frame.DataFrame'>\n",
      "RangeIndex: 9988 entries, 0 to 9987\n",
      "Data columns (total 5 columns):\n",
      "ID           9988 non-null object\n",
      "age          9988 non-null int64\n",
      "Gender       9988 non-null int64\n",
      "Education    9988 non-null int64\n",
      "QueryList    9988 non-null object\n",
      "dtypes: int64(3), object(2)\n",
      "memory usage: 390.2+ KB\n",
      "None\n",
      "                                 ID  age  Gender  Education  \\\n",
      "0  22DD920316420BE2DF8D6EE651BA174B    1       1          4   \n",
      "1  43CC3AF5A8D6430A3B572337A889AFE4    2       1          3   \n",
      "2  E97654BFF5570E2CCD433EA6128EAC19    4       1          0   \n",
      "3  6931EFC26D229CCFCEA125D3F3C21E57    4       2          3   \n",
      "4  E780470C3BB0D340334BD08CDCC3C71A    2       2          4   \n",
      "\n",
      "                                           QueryList  \n",
      "0  柔和双沟\\t女生\\t中财网首页 财经\\thttp://pan.baidu.com/s/1pl...  \n",
      "1  广州厨宝烤箱\\t世情薄,人情恶,雨送黄昏花易落,晓风干,泪痕\\t厦门酒店用品批发市场\\t我只...  \n",
      "2  钻石之泪耳机\\t盘锦到沈阳\\t旅顺公交\\t辽宁阜新车牌\\tbaidu\\tk715\\tk716...  \n",
      "3  最受欢迎狗狗排行榜\\t舶怎么读\\t场景描 写范例\\t三维绘图软件\\t枣和酸奶能一起吃吗\\t好...  \n",
      "4  干槽症能自愈吗\\t太太万岁叶舒心去没去美国\\t干槽症\\t右眼皮下面一直跳是怎么回事\\t麦当劳...  \n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "D:\\ProgramData\\Anaconda3\\lib\\site-packages\\ipykernel_launcher.py:12: FutureWarning: The signature of `Series.to_csv` was aligned to that of `DataFrame.to_csv`, and argument 'header' will change its default value from False to True: please pass an explicit value to suppress this warning.\n",
      "  if sys.path[0] == '':\n",
      "D:\\ProgramData\\Anaconda3\\lib\\site-packages\\ipykernel_launcher.py:13: FutureWarning: The signature of `Series.to_csv` was aligned to that of `DataFrame.to_csv`, and argument 'header' will change its default value from False to True: please pass an explicit value to suppress this warning.\n",
      "  del sys.path[0]\n",
      "D:\\ProgramData\\Anaconda3\\lib\\site-packages\\ipykernel_launcher.py:14: FutureWarning: The signature of `Series.to_csv` was aligned to that of `DataFrame.to_csv`, and argument 'header' will change its default value from False to True: please pass an explicit value to suppress this warning.\n",
      "  \n",
      "D:\\ProgramData\\Anaconda3\\lib\\site-packages\\ipykernel_launcher.py:16: FutureWarning: The signature of `Series.to_csv` was aligned to that of `DataFrame.to_csv`, and argument 'header' will change its default value from False to True: please pass an explicit value to suppress this warning.\n",
      "  app.launch_new_instance()\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'pandas.core.frame.DataFrame'>\n",
      "RangeIndex: 9979 entries, 0 to 9978\n",
      "Data columns (total 2 columns):\n",
      "ID           9979 non-null object\n",
      "QueryList    9979 non-null object\n",
      "dtypes: object(2)\n",
      "memory usage: 156.0+ KB\n",
      "None\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "D:\\ProgramData\\Anaconda3\\lib\\site-packages\\ipykernel_launcher.py:21: FutureWarning: The signature of `Series.to_csv` was aligned to that of `DataFrame.to_csv`, and argument 'header' will change its default value from False to True: please pass an explicit value to suppress this warning.\n"
     ]
    }
   ],
   "source": [
    "import pandas as pd\n",
    "\n",
    "#编码转换完成的数据，取的是1W的子集\n",
    "trainname = './data/user_tag_query.10W.TRAIN-1w.csv'\n",
    "testname = './data/user_tag_query.10W.TEST-1w.csv'\n",
    "\n",
    "data = pd.read_csv(trainname,encoding='gbk')\n",
    "print (data.info())\n",
    "print(data.head())\n",
    "\n",
    "#分别生成三种标签数据（性别，年龄，学历）\n",
    "data.age.to_csv(\"./data/train_age.csv\", index=False)\n",
    "data.Gender.to_csv(\"./data/train_gender.csv\", index=False)\n",
    "data.Education.to_csv(\"./data/train_education.csv\", index=False)\n",
    "#将搜索数据单独拿出来\n",
    "data.QueryList.to_csv(\"./data/train_querylist.csv\", index=False)\n",
    "\n",
    "data = pd.read_csv(testname,encoding='gbk')\n",
    "print (data.info())\n",
    "\n",
    "data.QueryList.to_csv(\"./data/test_querylist.csv\", index=False)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 对用户的搜索数据进行分词与词性过滤\n",
    "这里需要分别对训练集和测试集进行相同的操作，路径名字要改动一下"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "2000 finished\n",
      "4000 finished\n",
      "6000 finished\n",
      "8000 finished\n",
      "total time: 880.971740 s\n"
     ]
    }
   ],
   "source": [
    "import pandas as pd\n",
    "import jieba.analyse\n",
    "import time\n",
    "import jieba\n",
    "import jieba.posseg\n",
    "import os, sys\n",
    "\n",
    "\n",
    "def input(trainname):\n",
    "    traindata = []\n",
    "    with open(trainname, 'rb') as f:\n",
    "        line = f.readline()\n",
    "        count = 0\n",
    "        while line:\n",
    "            try:\n",
    "                traindata.append(line)\n",
    "                count += 1\n",
    "            except:\n",
    "                print (\"error:\", line, count)\n",
    "            line=f.readline()\n",
    "    return traindata\n",
    "start = time.clock()\n",
    "\n",
    "filepath = './data/test_querylist.csv'\n",
    "QueryList = input(filepath)\n",
    "\n",
    "writepath = './data/test_querylist_writefile-1w.csv'\n",
    "csvfile = open(writepath, 'w')\n",
    "\n",
    "POS = {}\n",
    "for i in range(len(QueryList)):\n",
    "    #print (i)\n",
    "    if i%2000 == 0 and i >=1000:\n",
    "        print (i,'finished') \n",
    "    s = []\n",
    "    str = \"\"\n",
    "    words = jieba.posseg.cut(QueryList[i])# 带有词性的精确分词模式\n",
    "    allowPOS = ['n','v','j']\n",
    "    for word, flag in words:\n",
    "        POS[flag]=POS.get(flag,0)+1\n",
    "        if (flag[0] in allowPOS) and len(word)>=2:\n",
    "            str += word + \" \"\n",
    "            \n",
    "    cur_str = str.encode('utf8')\n",
    "    cur_str = cur_str.decode('utf8')\n",
    "    s.append(cur_str)\n",
    "    \n",
    "    csvfile.write(\" \".join(s)+'\\n')\n",
    "csvfile.close()\n",
    "\n",
    "end = time.clock()\n",
    "print (\"total time: %f s\" % (end - start))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 使用Gensim库建立word2vec词向量模型\n",
    "### 参数定义：\n",
    "-  sentences：可以是一个list\n",
    "-  sg： 用于设置训练算法，默认为0，对应CBOW算法；sg=1则采用skip-gram算法。\n",
    "-  size：是指特征向量的维度，默认为100。大的size需要更多的训练数据,但是效果会更好. 推荐值为几十到几百。\n",
    "-  window：表示当前词与预测词在一个句子中的最大距离是多少\n",
    "-  alpha: 是学习速率\n",
    "-  seed：用于随机数发生器。与初始化词向量有关。\n",
    "-  min_count: 可以对字典做截断. 词频少于min_count次数的单词会被丢弃掉, 默认值为5\n",
    "-  max_vocab_size: 设置词向量构建期间的RAM限制。如果所有独立单词个数超过这个，则就消除掉其中最不频繁的一个。每一千万个单词需要大约1GB的RAM。设置成None则没有限制。\n",
    "\n",
    "-  workers参数控制训练的并行数。\n",
    "-  hs: 如果为1则会采用hierarchica·softmax技巧。如果设置为0（defau·t），则negative sampling会被使用。\n",
    "-  negative: 如果>0,则会采用negativesamp·ing，用于设置多少个noise words\n",
    "-  iter： 迭代次数，默认为5"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [],
   "source": [
    "from gensim.models import word2vec\n",
    "#将数据变换成list of list格式\n",
    "train_path = './data/train_querylist_writefile-1w.csv'\n",
    "with open(train_path, 'r') as f:\n",
    "    My_list = []\n",
    "    lines = f.readlines()\n",
    "    for line in lines:\n",
    "        cur_list = []\n",
    "        line = line.strip()\n",
    "        data = line.split(\" \")\n",
    "        for d in data:\n",
    "            cur_list.append(d)\n",
    "        My_list.append(cur_list)\n",
    "    \n",
    "    model = word2vec.Word2Vec(My_list, size=300, window=10,workers=4)  \n",
    "    savepath = '1w_word2vec_' + '300'+'.model' # 保存model的路径\n",
    "\n",
    "    model.save(savepath)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[('风雹', 0.8893747329711914),\n",
       " ('龙组', 0.8870506882667542),\n",
       " ('受欢迎', 0.8759890198707581),\n",
       " ('皮特', 0.8737666606903076),\n",
       " ('民调', 0.8706102967262268),\n",
       " ('许文强', 0.8705775141716003),\n",
       " ('黑老大', 0.8696860671043396),\n",
       " ('乞丐', 0.8689215779304504),\n",
       " ('圣域', 0.8689209818840027),\n",
       " ('群英', 0.8688154220581055)]"
      ]
     },
     "execution_count": 27,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "model.most_similar(\"大哥\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[('北京大学', 0.9314329028129578),\n",
       " ('委员', 0.9181340932846069),\n",
       " ('特长生', 0.9098962545394897),\n",
       " ('中国人民大学', 0.9066182374954224),\n",
       " ('北大', 0.9033325910568237),\n",
       " ('清华大学', 0.9025564789772034),\n",
       " ('工作部', 0.8978621363639832),\n",
       " ('复旦大学', 0.8967786431312561),\n",
       " ('金融学', 0.8937995433807373),\n",
       " ('投档', 0.8907859325408936)]"
      ]
     },
     "execution_count": 31,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "model.most_similar(\"清华\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 加载训练好的word2vec模型，求用户搜索结果的平均向量"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "file_name = './data/train_querylist_writefile-1w.csv'\n",
    "cur_model = gensim.models.Word2Vec.load('1w_word2vec_300.model')\n",
    "with open(file_name, 'r') as f:\n",
    "    cur_index = 0\n",
    "    lines = f.readlines()\n",
    "    doc_cev = np.zeros((len(lines),300))\n",
    "    for line in lines:\n",
    "        word_vec = np.zeros((1,300))\n",
    "        words = line.strip().split(' ')\n",
    "        wrod_num = 0\n",
    "        #求模型的平均向量\n",
    "        for word in words:\n",
    "            if word in cur_model:\n",
    "                wrod_num += 1\n",
    "                word_vec += np.array([cur_model[word]])\n",
    "        doc_cev[cur_index] = word_vec / float(wrod_num)\n",
    "        cur_index += 1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(9988, 300)"
      ]
     },
     "execution_count": 35,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "doc_cev.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([-0.32963576,  0.09165895,  0.37035566,  0.15858265, -0.25632772,\n",
       "        0.46823607,  0.08479289, -0.09562777, -0.48537965, -0.04363835,\n",
       "        0.48571603,  0.1187871 , -0.19456722,  0.20186944,  0.30645476,\n",
       "        0.01102684, -0.04478108,  0.20113739, -0.08005867, -0.95247635,\n",
       "       -0.01227955,  0.00696389, -0.3039621 ,  0.61217366,  0.21240715,\n",
       "        0.14640459, -0.21849218, -0.84263162,  0.52864702, -0.40276359,\n",
       "       -0.36570598,  0.10162218,  0.25552753, -0.2048686 ,  0.2416216 ,\n",
       "       -0.18987446, -0.00617808,  0.21611415,  0.43024731, -0.36179712,\n",
       "       -0.4873151 , -0.33222837, -0.09125527,  0.39969577,  0.3087728 ,\n",
       "       -0.13975002, -0.00378791,  0.0189908 , -0.16623354,  0.05266528,\n",
       "        0.29755896, -0.38497848,  0.43066086,  0.10289612, -0.71760135,\n",
       "       -0.40782765, -0.4868693 , -0.16743555,  0.15261012, -0.2065284 ,\n",
       "        0.32500373,  0.20506871,  0.11342901,  0.26840977, -0.11748349,\n",
       "       -0.94276241, -0.10549763,  0.23851692,  0.03458147, -0.0464649 ,\n",
       "        0.12660487,  0.115064  , -0.50057272,  0.03036385, -0.47797342,\n",
       "        0.40371016, -0.29718234, -0.43518607, -0.25809123,  0.1015052 ,\n",
       "        0.47394373,  0.33723481, -0.02807736,  0.13100867, -0.40864251,\n",
       "       -0.19658049,  0.10884791, -0.09311189, -0.28571925,  0.07907474,\n",
       "       -0.29676062,  0.14133168,  0.10930606, -0.66807725,  0.05400282,\n",
       "        0.15089761, -0.04746405, -0.12516539, -0.14732327,  0.22287856,\n",
       "       -0.38040873, -0.13006167,  0.49388525,  0.16460076,  0.20086135,\n",
       "       -0.12753868, -0.31403303,  0.39208034,  0.12763156, -0.17989271,\n",
       "        0.74035939,  0.02526545,  0.28468999,  0.09878702, -0.26058408,\n",
       "       -0.10912253,  0.41135938,  0.06814576,  0.10943505,  0.48908335,\n",
       "       -0.55817829,  0.44446264, -0.2142216 ,  0.28669601, -0.06806997,\n",
       "        0.32889622, -0.26794026,  0.08555511,  0.17845941,  0.31040895,\n",
       "       -0.23255443, -0.45486659,  0.04987576, -0.23159872,  0.04333505,\n",
       "        0.23260261, -0.09733406, -0.09025638, -0.16753649, -0.08350396,\n",
       "        0.30702695, -0.10648519,  0.14233887, -0.00367312,  0.05064262,\n",
       "        0.43444754,  0.06561184,  0.18829253, -0.41461331,  0.12235426,\n",
       "        0.65492599, -0.40869095,  0.3113111 , -0.54785562, -0.10833833,\n",
       "        0.02252328,  0.16255338, -0.47358192, -0.24450507,  0.16321378,\n",
       "        0.07391855, -0.47419369, -0.30632154, -0.11040633, -0.32382616,\n",
       "        0.4426617 , -0.10495184,  0.12043541,  0.16823796, -0.26624361,\n",
       "        0.03156757,  0.41249994,  0.28768812,  0.06821814,  0.14931934,\n",
       "        0.01452552, -0.11192023,  0.2401444 ,  0.81160051, -0.15561617,\n",
       "       -0.00851408,  0.14234263, -0.15036674,  0.27918601, -0.20261046,\n",
       "        0.48531595, -0.09695027,  0.43428636,  0.47068082,  0.22846106,\n",
       "        0.00267283, -0.05437145,  0.25176264,  0.01610542, -0.13377017,\n",
       "        0.54657426, -0.13698806, -0.2302585 ,  0.36414475, -0.5585176 ,\n",
       "       -0.11826485,  0.02389447,  0.14390101,  0.20963641, -0.36069587,\n",
       "       -0.38429115, -0.42740024,  0.32145675,  0.36834208, -0.33589502,\n",
       "        0.07253859, -0.09847854,  0.08053196, -0.58872708, -0.10989451,\n",
       "        0.00407032,  0.08675866, -0.43364337, -0.36151412,  0.6554481 ,\n",
       "       -0.20708218, -0.27980593,  0.261462  , -0.02246014, -0.16137311,\n",
       "       -0.46587461,  0.12570722,  0.47609159, -0.80395626, -0.29268759,\n",
       "       -0.10333538,  0.03933692,  0.04698488,  0.1476835 ,  0.26553862,\n",
       "        0.34751173,  0.32180609, -0.02186607, -0.33745243, -0.33645018,\n",
       "        0.13709604,  0.0999778 ,  0.14847581,  0.00783516,  0.15957733,\n",
       "       -0.1676401 , -0.6420265 ,  0.50472352,  0.40206853,  0.21659084,\n",
       "        0.33697318, -0.24802424,  0.28707762, -0.14412461,  0.04660551,\n",
       "        0.26121769, -0.4958752 , -0.29724882, -0.07021731, -0.07079926,\n",
       "        0.18842558,  0.44013915, -0.1701221 ,  0.31210531, -0.33530001,\n",
       "       -0.09067814, -0.21550897, -0.02647056,  0.09420646,  0.03378421,\n",
       "       -0.56585487, -0.32820684, -0.10717299,  0.13301143, -0.11684624,\n",
       "        0.77486023, -0.52552847, -0.39691189, -0.55076384,  0.23266931,\n",
       "       -0.46448507,  0.37123723, -0.00407564,  0.38833145,  0.406973  ,\n",
       "       -0.63584117,  0.04566764,  0.27395144, -0.46276836,  0.2779322 ,\n",
       "       -0.14517526,  0.75888999,  0.68745523, -0.00525145, -0.20321669,\n",
       "       -0.02939657, -0.08188582, -0.3656461 , -0.05779847,  0.26803044])"
      ]
     },
     "execution_count": 36,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "doc_cev[5]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(9988,)"
      ]
     },
     "execution_count": 37,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "genderlabel = np.loadtxt(open('./data/train_gender.csv', 'r')).astype(int)\n",
    "genderlabel.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(9988,)"
      ]
     },
     "execution_count": 39,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "educationlabel = np.loadtxt(open('./data/train_education.csv', 'r')).astype(int)\n",
    "educationlabel.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 40,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(9988,)"
      ]
     },
     "execution_count": 40,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "agelabel = np.loadtxt(open('./data/train_age.csv', 'r')).astype(int)\n",
    "agelabel.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 41,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(9756, 300) (9756,)\n",
      "(9815, 300) (9815,)\n",
      "(9064, 300) (9064,)\n"
     ]
    }
   ],
   "source": [
    "def removezero(x, y):\n",
    "        nozero = np.nonzero(y)\n",
    "        y = y[nozero]\n",
    "        x = np.array(x)\n",
    "        x = x[nozero]\n",
    "        return x, y\n",
    "gender_train, genderlabel = removezero(doc_cev, genderlabel)\n",
    "age_train, agelabel = removezero(doc_cev, agelabel)\n",
    "education_train, educationlabel = removezero(doc_cev, educationlabel)\n",
    "print (gender_train.shape,genderlabel.shape)\n",
    "print (age_train.shape,agelabel.shape)\n",
    "print (education_train.shape,educationlabel.shape)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 绘图函数，以性别为例，绘制混淆矩阵"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 42,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "import matplotlib.pyplot as plt\n",
    "import itertools\n",
    "def plot_confusion_matrix(cm, classes,\n",
    "                          title='Confusion matrix',\n",
    "                          cmap=plt.cm.Blues):\n",
    "    \"\"\"\n",
    "    This function prints and plots the confusion matrix.\n",
    "    \"\"\"\n",
    "    plt.imshow(cm, interpolation='nearest', cmap=cmap)\n",
    "    plt.title(title)\n",
    "    plt.colorbar()\n",
    "    tick_marks = np.arange(len(classes))\n",
    "    plt.xticks(tick_marks, classes, rotation=0)\n",
    "    plt.yticks(tick_marks, classes)\n",
    "\n",
    "    thresh = cm.max() / 2.\n",
    "    for i, j in itertools.product(range(cm.shape[0]), range(cm.shape[1])):\n",
    "        plt.text(j, i, cm[i, j],\n",
    "                 horizontalalignment=\"center\",\n",
    "                 color=\"white\" if cm[i, j] > thresh else \"black\")\n",
    "\n",
    "    plt.tight_layout()\n",
    "    plt.ylabel('True label')\n",
    "    plt.xlabel('Predicted label')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 测试集的构造方法和训练集一样"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 44,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "file_name = './data/test_querylist_writefile-1w.csv'\n",
    "cur_model = gensim.models.Word2Vec.load('1w_word2vec_300.model')\n",
    "with open(file_name, 'r') as f:\n",
    "    cur_index = 0\n",
    "    lines = f.readlines()\n",
    "    doc_cev = np.zeros((len(lines),300))\n",
    "    for line in lines:\n",
    "        word_vec = np.zeros((1,300))\n",
    "        words = line.strip().split(' ')\n",
    "        wrod_num = 0\n",
    "        #求模型的平均向量\n",
    "        for word in words:\n",
    "            if word in cur_model:\n",
    "                wrod_num += 1\n",
    "                word_vec += np.array([cur_model[word]])\n",
    "        doc_cev[cur_index] = word_vec / float(wrod_num)\n",
    "        cur_index += 1"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 检查一下数据有木有问题"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 45,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(9979, 300)"
      ]
     },
     "execution_count": 45,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "doc_cev.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 86,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([ -1.40948582e-01,  -7.83803609e-02,   2.15763443e-01,\n",
       "         1.37518199e-01,   2.30699531e-01,  -3.89948267e-02,\n",
       "        -1.31107922e-01,  -3.12056526e-01,  -4.11792463e-01,\n",
       "         5.50757989e-01,   6.35229338e-02,   1.02547314e-01,\n",
       "        -3.52964044e-02,   6.36397276e-02,   7.96098084e-02,\n",
       "         3.74873843e-01,   1.10930597e-01,   3.76115695e-01,\n",
       "        -6.18163756e-01,  -4.65835745e-01,   1.80290355e-02,\n",
       "         7.01652931e-02,  -9.72175971e-02,   2.64578183e-01,\n",
       "         2.51769353e-01,  -3.53601411e-02,  -1.43570983e-01,\n",
       "        -3.18113600e-01,   1.44785517e-01,  -2.82206427e-01,\n",
       "        -5.70270152e-02,  -1.97119162e-01,   1.74863956e-01,\n",
       "         2.87672050e-01,  -4.30430668e-02,   1.57361957e-02,\n",
       "         1.49231222e-01,   5.42560797e-02,  -7.76399297e-02,\n",
       "         1.64214515e-01,   1.20145906e-01,  -2.70355637e-01,\n",
       "        -1.77872375e-01,  -1.96268085e-01,   1.17089703e-01,\n",
       "        -1.33172379e-01,   3.49030844e-01,  -3.22540690e-01,\n",
       "         3.97371212e-01,  -9.61756605e-02,   1.65732211e-01,\n",
       "        -2.56990549e-01,   2.85370306e-01,   3.19634359e-01,\n",
       "        -7.41363497e-01,   2.26774279e-01,  -2.83798796e-01,\n",
       "        -1.44546568e-01,  -3.52339115e-01,  -5.80674479e-01,\n",
       "         2.68324686e-02,   1.30227786e-01,  -1.00441239e-01,\n",
       "         2.60390847e-01,   1.25201744e-01,  -5.25418328e-01,\n",
       "         1.75344290e-01,  -3.24041139e-01,  -3.47078656e-01,\n",
       "         9.96726972e-02,   2.94179513e-01,   5.86952848e-02,\n",
       "        -4.52377116e-01,   3.91487138e-01,  -2.96458369e-02,\n",
       "         3.57184175e-01,  -1.49425127e-01,  -2.88320325e-01,\n",
       "         1.19009884e-01,   1.53337095e-01,   3.04089592e-01,\n",
       "         1.89093039e-01,  -8.01449750e-02,  -2.72685380e-01,\n",
       "        -4.78048256e-01,  -1.04029769e-01,  -2.53193670e-02,\n",
       "        -9.88348940e-02,   6.72267633e-02,  -1.35439469e-01,\n",
       "        -1.49475906e-01,   2.47927792e-01,  -2.29743023e-02,\n",
       "        -5.29090241e-01,   3.73187952e-01,  -2.65394696e-01,\n",
       "        -8.31289100e-02,   5.56965526e-02,   2.14333441e-01,\n",
       "         1.92153409e-01,  -3.00052316e-02,  -9.30547491e-03,\n",
       "         3.18235280e-01,  -3.64601172e-03,   8.56713321e-02,\n",
       "        -1.10520001e-01,  -1.49643275e-01,   6.91972886e-02,\n",
       "         1.23134823e-01,  -7.75075809e-02,   5.42482856e-01,\n",
       "         1.43055086e-01,   4.44486456e-01,  -9.02878603e-03,\n",
       "        -1.34953890e-01,  -2.80393652e-01,   4.14887106e-01,\n",
       "        -2.58688901e-01,   1.09647165e-01,   4.90923951e-01,\n",
       "        -1.07369959e-01,   9.85647436e-02,   6.45887209e-02,\n",
       "         2.08114233e-01,   4.44177480e-01,   1.63236788e-02,\n",
       "        -2.13737596e-01,  -1.64759588e-02,  -7.33868393e-02,\n",
       "        -1.69475997e-01,   1.84795928e-01,  -1.71021813e-01,\n",
       "         3.37551498e-01,  -4.18199906e-01,   1.68135302e-01,\n",
       "         5.83188431e-01,   8.44808696e-02,  -3.01729720e-01,\n",
       "        -5.44056941e-02,  -5.01904171e-01,   4.50453867e-02,\n",
       "        -1.34148384e-01,  -1.09624350e-01,  -2.28562564e-01,\n",
       "        -8.74148456e-02,   5.14487026e-01,  -6.82040735e-02,\n",
       "         1.42633205e-02,  -2.21542264e-01,   8.54630125e-02,\n",
       "         4.33518036e-01,  -3.07814894e-01,   1.65930993e-01,\n",
       "         4.79102304e-02,  -1.71665333e-01,   3.76908141e-01,\n",
       "        -1.03881134e-01,  -6.54404759e-02,   5.41581047e-02,\n",
       "        -1.76413839e-01,  -6.41639515e-02,   1.87052546e-02,\n",
       "        -1.86727214e-01,  -2.13807726e-01,   2.64558045e-02,\n",
       "         1.12986099e-02,   2.59199294e-02,   1.72955850e-01,\n",
       "         2.41384881e-02,  -2.49181183e-01,  -3.36226916e-02,\n",
       "         3.12396280e-01,  -7.10716655e-02,   1.41957853e-01,\n",
       "         4.33302311e-02,  -1.71326419e-01,  -4.23237721e-02,\n",
       "         2.17981140e-01,   4.81248016e-01,  -1.36628612e-01,\n",
       "        -1.28410544e-01,   1.37293549e-01,  -1.05855086e-03,\n",
       "         1.12310009e-01,  -6.95367588e-02,   2.37597305e-01,\n",
       "        -5.06024585e-02,   3.25808196e-01,   5.04108550e-02,\n",
       "        -1.03161489e-01,  -3.18683370e-02,   2.07050781e-01,\n",
       "         2.32622048e-01,   1.09607814e-01,  -2.02571237e-01,\n",
       "         2.21797040e-01,   1.57109446e-02,  -8.32174541e-03,\n",
       "        -2.89447302e-02,  -5.89619436e-02,   5.04595983e-03,\n",
       "         1.00301721e-01,   1.77807568e-01,   1.80031702e-01,\n",
       "        -1.78756833e-01,  -4.96270915e-02,  -2.01401724e-01,\n",
       "        -6.88299324e-02,   3.80466614e-02,  -8.97671802e-02,\n",
       "         1.23843802e-01,   1.48419188e-01,   4.11191454e-01,\n",
       "        -4.09973626e-01,   2.02094581e-02,   2.29991899e-01,\n",
       "         3.88508727e-03,  -5.37772566e-02,   1.34938583e-01,\n",
       "         9.52932437e-02,  -6.60675191e-02,   1.64473244e-01,\n",
       "         1.03883225e-01,   3.68080529e-01,   3.59169433e-02,\n",
       "        -2.22347876e-01,  -4.04169535e-04,  -2.02010820e-01,\n",
       "        -1.70386865e-01,  -2.26100472e-01,   1.92192369e-01,\n",
       "         3.00625259e-02,   4.96574875e-02,  -2.59091008e-01,\n",
       "         3.78451141e-01,  -3.29397345e-02,   6.05657937e-02,\n",
       "        -7.79888225e-02,  -1.22575964e-01,  -1.13144478e-01,\n",
       "        -2.25677325e-01,   7.99204554e-02,  -2.01282361e-01,\n",
       "        -1.33029371e-01,   3.76205506e-03,   6.75233095e-02,\n",
       "        -3.35603916e-01,   1.71610489e-01,  -1.16427214e-02,\n",
       "        -2.60864464e-02,   1.99156409e-01,   3.98823069e-02,\n",
       "         3.39077864e-01,  -1.81840025e-01,   1.92434707e-01,\n",
       "        -2.97013010e-01,  -1.27019203e-01,   3.06605723e-02,\n",
       "        -6.19746033e-01,   8.65698095e-03,   2.13373301e-01,\n",
       "        -1.91994441e-01,   4.57072244e-02,  -1.19119613e-01,\n",
       "        -7.25762239e-03,  -2.98017610e-01,   1.23103205e-01,\n",
       "        -1.69341788e-01,  -3.24221429e-01,  -5.99784187e-02,\n",
       "        -3.44934522e-01,   5.19845133e-02,   8.97832900e-02,\n",
       "         3.37738377e-01,  -8.66587441e-03,   2.13077151e-01,\n",
       "         1.46266277e-01,  -1.42924507e-01,  -2.88011378e-01,\n",
       "         1.67301122e-01,  -1.29536835e-01,   1.83163343e-01,\n",
       "         2.09710721e-01,  -4.49811679e-02,   1.55367921e-01,\n",
       "        -1.22155753e-01,  -1.38951005e-02,   8.81559829e-02,\n",
       "        -1.94378444e-01,   1.19864592e-01,  -3.01905232e-01,\n",
       "         3.64807011e-01,  -9.66293904e-02,  -2.08392710e-01,\n",
       "         2.12934604e-01,   3.86165855e-02,  -4.61727517e-01,\n",
       "        -8.28338212e-02,   6.93420664e-02,   3.65292702e-01])"
      ]
     },
     "execution_count": 86,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "doc_cev[6]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 建立一个基础预测模型"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 57,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Anaconda3\\lib\\site-packages\\sklearn\\cross_validation.py:44: DeprecationWarning: This module was deprecated in version 0.18 in favor of the model_selection module into which all the refactored classes and functions are moved. Also note that the interface of the new CV iterators are different from that of this module. This module will be removed in 0.20.\n",
      "  \"This module will be removed in 0.20.\", DeprecationWarning)\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0.798155737705\n",
      "Recall metric in the testing dataset:  0.735074626866\n",
      "accuracy metric in the testing dataset:  0.798155737705\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAc4AAAGbCAYAAABNpXD0AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAAPYQAAD2EBqD+naQAAIABJREFUeJzt3XmcVmX9//HXe1A2FUSJwQXcMLTc13CtMLfSXEpJU3PJ\nTDHTSrMsUdq+pkYW/rLcLTPF3HBBxR1NDVFTEUVAVBZFEHDYmc/vj3MG77kdmPvcnGHm5n4/fZwH\nc1/nOte57hucz/25ruuco4jAzMzMSlPT2h0wMzOrJA6cZmZmGThwmpmZZeDAaWZmloEDp5mZWQYO\nnGZmZhk4cJqZmWXgwGlmZpaBA6eZmVkGDpyWG0mTJF3b2v1YVST1lPRvSTMkLZV0es7tt5NUL+ln\neba7OpD0lKQHW7sfVp0cOCuQpE0l/VnSOEl16fZqWrZtK3Ztld+/MQ1el0t6Pf0c5kp6XtLPJHVp\n4dNfAXwZ+BVwHNASv8iDVvhcVxVJG0m6UNI2GQ9drT8Xa9vWaO0OWDaSvgbcAiwG/gG8BNQDWwFH\nAKdJ2iwi3mm9Xq4aknYH7gM6AH8HRpN8GdwFOB/YA/haC3bhS8DtETGkJRqPiKWSOpH8Xa+uNgYu\nBN4EXslw3Jdw4LRW4sBZQSRtDvwTmAj0j4j3i/afB5xOEkgrmqR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rPo44zQzM8vAgdPMzCwDB04zM7MMHDjNzMwycOA0MzPL\nwIHTzMwsAwdOMzOzDBw4zczMMnDgNDMzy8CB08zMLAMHTjMzswwcOM3MzDL4/6FcHC9skPAyAAAA\nAElFTkSuQmCC\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x1f7f54f2240>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "from sklearn.linear_model import LogisticRegression\n",
    "from sklearn.metrics import confusion_matrix\n",
    "from sklearn.cross_validation import train_test_split\n",
    "\n",
    "X_train, X_test, y_train, y_test = train_test_split(gender_train,genderlabel,test_size = 0.2, random_state = 0)\n",
    "\n",
    "LR_model = LogisticRegression()\n",
    "\n",
    "LR_model.fit(X_train,y_train)\n",
    "y_pred = LR_model.predict(X_test)\n",
    "print (LR_model.score(X_test,y_test))\n",
    "\n",
    "cnf_matrix = confusion_matrix(y_test,y_pred)\n",
    "\n",
    "print(\"Recall metric in the testing dataset: \", cnf_matrix[1,1]/(cnf_matrix[1,0]+cnf_matrix[1,1]))\n",
    "\n",
    "print(\"accuracy metric in the testing dataset: \", (cnf_matrix[1,1]+cnf_matrix[0,0])/(cnf_matrix[0,0]+cnf_matrix[1,1]+cnf_matrix[1,0]+cnf_matrix[0,1]))\n",
    "\n",
    "# Plot non-normalized confusion matrix\n",
    "class_names = [0,1]\n",
    "plt.figure()\n",
    "plot_confusion_matrix(cnf_matrix\n",
    "                      , classes=class_names\n",
    "                      , title='Gender-Confusion matrix')\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 63,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0.795081967213\n",
      "Recall metric in the testing dataset:  0.730099502488\n",
      "accuracy metric in the testing dataset:  0.795081967213\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAc4AAAGbCAYAAABNpXD0AAAABHNCSVQICAgIfAhkiAAAAAlwSFl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9umfXXg\nNCuRA6c1t8eAE4DFwOSIWFa0f37R12ulfx5HQUBKLV2JfhSfpxRrAfeSDCWraN8UYIuV6E+hG4F1\nSbLHSSSLp57nsyHtUqwF/Bc4nM/39aPPVzezFfEcpzW3uRExISLerydofk5EfAhMBjaPiPFF27tp\ntTHAdpIKA0v/Rpp+FRjQwP5FJJleoZdJ5l3fracv84F3gCUk85IASFoX+GJj11lkV+DSiBgeEWNI\nfsnYoJ56X67n6zEFfd0C+KievhZnoWbWAAdOq0RnAWdIOlnSFunK1h9KOjXdfzPJcOnVkraStB/w\ni3raKcy8zgd2kXS5pG0lbSnpBEnrpfsnAv3SBynUrpq9HFiPZBFOH0mbSdpH0rWSFBFzgWuAv0j6\nmqRtgOvInhm/DRyZ9qkf8A9gXj31DpF0dPqZnA3sAlyW7vsnMB24R9Lukr4g6auSLpHULWN/zKqa\nA6dVnIi4hmSo9miSTPEJ4AfA+HT/XJJVrNuQZFrnkgynfq6pgjbfJln1uh3wAskDEg4kyRghWR27\nFHiDZGVvj4iYQrJCtRXJitVXgYuBmQX3mv4KeJpkSPc/6d9HZrzkY0iGakcCN5Asniq+BzVIfqEY\nBIwGvg8Miog30+ubD+xJMtR7R3od/0cyx1nSQyDMLKHy7yU3MzOrPs44zczMMnDgNDMzy8CB08zM\nLAMHTjMzswwcOM3MzDJw4DQzM8vAgdPMzCwDB04zM7MMHDjNzMwycOA0MzPLwIHTzMwsAwdOMzOz\nDP4/X81Gcg8sG1YAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x1f781f32ef0>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "from sklearn.ensemble import RandomForestClassifier\n",
    "from sklearn.metrics import confusion_matrix\n",
    "from sklearn.cross_validation import train_test_split\n",
    "\n",
    "X_train, X_test, y_train, y_test = train_test_split(gender_train,genderlabel,test_size = 0.2, random_state = 0)\n",
    "\n",
    "RF_model = RandomForestClassifier(n_estimators=100,min_samples_split=5,max_depth=10)\n",
    "\n",
    "RF_model.fit(X_train,y_train)\n",
    "y_pred = RF_model.predict(X_test)\n",
    "print (RF_model.score(X_test,y_test))\n",
    "\n",
    "cnf_matrix = confusion_matrix(y_test,y_pred)\n",
    "\n",
    "print(\"Recall metric in the testing dataset: \", cnf_matrix[1,1]/(cnf_matrix[1,0]+cnf_matrix[1,1]))\n",
    "\n",
    "print(\"accuracy metric in the testing dataset: \", (cnf_matrix[1,1]+cnf_matrix[0,0])/(cnf_matrix[0,0]+cnf_matrix[1,1]+cnf_matrix[1,0]+cnf_matrix[0,1]))\n",
    "\n",
    "# Plot non-normalized confusion matrix\n",
    "class_names = [0,1]\n",
    "plt.figure()\n",
    "plot_confusion_matrix(cnf_matrix\n",
    "                      , classes=class_names\n",
    "                      , title='Gender-Confusion matrix')\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 堆叠模型\n",
    "<img src=\"./img/2.png\" alt=\"FAO\" width=\"700\" >"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 74,
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn.svm import SVC\n",
    "from sklearn.naive_bayes import MultinomialNB\n",
    "clf1 = RandomForestClassifier(n_estimators=100,min_samples_split=5,max_depth=10)\n",
    "clf2 = SVC()\n",
    "clf3 = LogisticRegression()\n",
    "basemodes = [\n",
    "            ['rf', clf1],\n",
    "            ['svm', clf2],\n",
    "            ['lr', clf3]\n",
    "            ]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 84,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "5\n",
      "0.796106557377\n"
     ]
    }
   ],
   "source": [
    "from sklearn.cross_validation import KFold, StratifiedKFold\n",
    "models = basemodes\n",
    "\n",
    "#X_train, X_test, y_train, y_test\n",
    "\n",
    "folds = list(KFold(len(y_train), n_folds=5, random_state=0))\n",
    "print (len(folds))\n",
    "S_train = np.zeros((X_train.shape[0], len(models)))\n",
    "S_test = np.zeros((X_test.shape[0], len(models)))\n",
    "\n",
    "for i, bm in enumerate(models):\n",
    "    clf = bm[1]\n",
    "\n",
    "    #S_test_i = np.zeros((y_test.shape[0], len(folds)))\n",
    "    for j, (train_idx, test_idx) in enumerate(folds):\n",
    "        X_train_cv = X_train[train_idx]\n",
    "        y_train_cv = y_train[train_idx]\n",
    "        X_val = X_train[test_idx]\n",
    "        clf.fit(X_train_cv, y_train_cv)\n",
    "        y_val = clf.predict(X_val)[:]\n",
    "          \n",
    "        S_train[test_idx, i] = y_val\n",
    "    S_test[:,i] = clf.predict(X_test)\n",
    "\n",
    "final_clf = RandomForestClassifier(n_estimators=100)\n",
    "final_clf.fit(S_train,y_train)\n",
    "\n",
    "print (final_clf.score(S_test,y_test))\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 82,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([ 1.,  1.,  2.])"
      ]
     },
     "execution_count": 82,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": []
  }
 ],
 "metadata": {
  "anaconda-cloud": {},
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 1
}
